home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / fc20.zip / FC.DOC next >
Text File  |  1990-03-21  |  28KB  |  592 lines

  1.  
  2.  
  3.  
  4.                                     FC Ver. 2.0
  5.                                     Mike Albert
  6.                                 Copyright (c) 1990
  7.  
  8.  
  9.  
  10.      1   INTRODUCTION
  11.  
  12.      FC compares two text files and lists the differences between them line
  13.      by line.  FC provides the following benefits:
  14.  
  15.          o   FC can show word by word differences between lines that have
  16.              changed.
  17.  
  18.          o   FC helps "C" programmers merge program changes.  FC can compare
  19.              two "C" programs containing separate sets of changes, and
  20.              combine them automatically to make a single program.
  21.  
  22.          o   FC lets you do multiple comparisons in one run.
  23.  
  24.          o   FC can ignore white space changes.  This is useful when you want
  25.              to ignore format changes in "C" programs or other text.
  26.  
  27.          o   FC never gets confused or "unsynchronized" (as some comparison
  28.              programs can).
  29.  
  30.          o   FC always finds the smallest set of differences between files,
  31.              and never misses matching lines.
  32.  
  33.          o   FC lets you list changes in ways that make sense to you by
  34.              providing multiple display options.  You can also customize FC
  35.              to use your favorite options automatically.
  36.  
  37.      If you're familiar with earlier versions of FC, look at section 7 to
  38.      learn about the enhancements.
  39.  
  40.      FC can be used on any IBM-compatible computer.  Any display adapter that
  41.      provides 25 lines of 80 characters will work correctly.  FC runs under
  42.      MS-DOS versions 2.0 and later, but 3.0 or later is required to customize
  43.      the default options.  The amount of memory required is dependent on file
  44.      size.  100K is enough for small files, while up to 425K is needed for
  45.      large ones.  Files containing up to 16,300 lines can be compared.
  46.  
  47.  
  48.  
  49.      2   OPERATION
  50.  
  51.      To list the differences between two ASCII text files line by line:
  52.              fc  file1  file2  options
  53.  
  54.      Changes to file1 to make file2 are listed.  Wild-card characters can be
  55.      used to do multiple comparisons.  The options are:
  56.  
  57.              -a      list all lines (whether different or the same)
  58.              -s      list only lines that are the same
  59.              -w      ignore white space differences in lines when comparing
  60.              -b      don't list redundant blank lines
  61.              -f      list using an alternate format that's useful for editing
  62.              -m      merge two C programs
  63.  
  64.  
  65.              -c<n>   show context for changes - list up to <n> unchanged
  66.                      lines as changed when that's clearer - default <n> is 1
  67.              -d<n>   show differences between changed lines word by word -
  68.                      <n> = 1 shows minor differences, 10 shows all - default
  69.                      <n> is 5
  70.              -t<n>   tab interval is <n> characters - default interval is 8
  71.              -u      update default options, -u- clears old defaults first
  72.              >file3  put difference listing in file file3
  73.  
  74.      A default option can be turned off with a minus sign, e.g. -m- turns off
  75.      the -m option.  You can also make an option affect only screen output or
  76.      file output - an "s" after the option letter indicates screen output,
  77.      while "f" indicates file output.  E.g. -ds5 specifies that the -d5
  78.      option is used for screen output, but doesn't affect output to a file.
  79.      This feature is useful when updating default options (with the -u
  80.      option), because you often want different options for the two output
  81.      devices.
  82.  
  83.      The following examples illustrate the use of FC:
  84.  
  85.          Compare two files in the current directory and display the
  86.          differences on the screen:
  87.  
  88.              fc  prog1.asc  prog2.asc
  89.  
  90.          Compare two files in different directories and drives, list all
  91.          lines using the alternate listing format (ignoring white space
  92.          differences when comparing), and put the difference listing in file
  93.          prog2.dif:
  94.  
  95.              fc  d:\backup\prog1.asc  c:\tc\prog2.asc  -a  -w  >prog2.dif
  96.  
  97.          Compare two files with the same names in different directories and
  98.          drives, and display the differences using the alternate listing
  99.          format:
  100.  
  101.              fc  -f  d:\backup\prog1.asc  c:\tc
  102.  
  103.          Compare all files with ".c" extensions and the same names in two
  104.          different directories:
  105.  
  106.              fc  \backup\*.c  \tc\*.*
  107.  
  108.          Merge two "C" programs to make a single combined program:
  109.  
  110.              fc  dbupdat1.c  dbupdat2.c  -m  >dbupdat3.c
  111.  
  112.          Change the default options for future invocations of FC to -w -c -b
  113.          for output to either output device, and -d5 for output to the
  114.          screen:
  115.  
  116.              fc  -u-  -w  -c  -b  -ds5
  117.  
  118.          Turn off the -w default option (which was previously set) for output
  119.          to a file, but leave it on for screen output:
  120.  
  121.              fc  -u  -wf-
  122.  
  123.  
  124.      3   DETAILED OPERATION
  125.  
  126.      The arguments to FC (files and options) can be supplied in any order.
  127.      The options work as follows:
  128.  
  129.          -a      All - FC normally lists only the lines that differ between
  130.                  the two files.  With the -a option, matching lines are also
  131.                  listed.
  132.  
  133.          -s      Same - With the -s option, only matching lines are listed.
  134.  
  135.          -w      White space - FC normally lists lines as different if any
  136.                  character in the line (except trailing white space) is
  137.                  different.  With this option, differences in embedded white
  138.                  space (i.e. space and tab characters) are ignored.  This is
  139.                  useful when you want to ignore differences in the layout of
  140.                  programs or documents.  FC knows about "C" language syntax,
  141.                  so that only white space that is ignored by a "C" compiler
  142.                  is ignored by FC.
  143.  
  144.          -b      Blanks - FC normally lists all lines that have changed.
  145.                  With this option, redundant blank lines (i.e. more than one
  146.                  blank line in a row, or blank lines leading or trailing a
  147.                  group of changes) aren't shown.
  148.  
  149.          -f      Format - This option directs FC to list changes using a
  150.                  different format that doesn't indent, and shows the line
  151.                  numbers of changes in both files.  This format is useful
  152.                  when directing the listing to a file used to re-create
  153.                  changes.
  154.  
  155.          -m      Merge format - FC merges two "C" programs into a single
  156.                  program when this option is used.  The new file can be
  157.                  compiled as the first program, the second program, or the
  158.                  combination of the two.  When you #define the symbol
  159.                  FC_FILE_1, lines present in the first file are included.
  160.                  FC_FILE_2 does the same thing for the second file.  If you
  161.                  specify both #define's, lines from both programs are
  162.                  included.  This feature is particularly useful when
  163.                  combining two separate sets of changes to a program.  You
  164.                  merge the two changed programs, examine the combined
  165.                  program, and remove the #ifdefs to complete the merge.  In
  166.                  most cases the #ifdefs can be removed without incident.
  167.                  Where there are conflicts between the two sets of changes,
  168.                  you can resolve them as needed.  If you feel brave, you can
  169.                  compile the merged program with both #define's specified and
  170.                  see if it works.  The merge does not always produce a
  171.                  compilable program - if the changes involve comments,
  172.                  #ifdef's, or multiline #defines, the #ifdef's inserted can
  173.                  conflict with them.
  174.  
  175.          -c<n>   Context - When this option is used, FC shows context
  176.                  surrounding changes to make the listing more readable.  This
  177.                  is done